/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.manager;

import ru.jSkyRoom.support.recoder.DoubleStringRecoder;
import ru.jSkyRoom.support.recoder.DwindleStringRecoder;
import ru.jSkyRoom.support.recoder.OneStringRecoder;
import ru.jSkyRoom.support.recoder.RecoderFacade;
import ru.jSkyRoom.support.recoder.StringRecoder;

/**
 *
 * @author Rakev
 */
public class LocaleManager {

    private final static LocaleManager instance = new LocaleManager();

    public static LocaleManager getInstance() {
        return instance;
    }
    private RecoderFacade recoder = new RecoderFacade(new DwindleStringRecoder());

    private LocaleManager() {
    }

    public void setCodePoint(String codePoint1, String codePoint2) {
        StringRecoder stringRecoder = new DoubleStringRecoder(codePoint1, codePoint2);
        recoder = new RecoderFacade(stringRecoder);
    }

    public void setCodePoint(String codePoint) {
        StringRecoder stringRecoder = new OneStringRecoder(codePoint);
        recoder = new RecoderFacade(stringRecoder);
    }

    public void selectRULocale() {
        setCodePoint("cp1251", "cp1252");
    }

    public RecoderFacade getRecoder() {
        return recoder;
    }
}
